//
//  DianpuJianjieViewController.m
//  跨界收
//
//  Created by Allen on 2018/11/7.
//  Copyright © 2018年 gztx. All rights reserved.
//

#import "DianpuJianjieViewController.h"

@interface DianpuJianjieViewController ()<UITextViewDelegate>
@property (weak, nonatomic) IBOutlet UITextView *jianjieTextView;
@property (weak, nonatomic) IBOutlet UILabel *jianjieLabel;

@end

@implementation DianpuJianjieViewController
- (IBAction)click:(id)sender {
    if (_jianjieTextView.text.length > 0) {
        if (self.jianjieBlock) {
            self.jianjieBlock(_jianjieTextView.text);
        }
    }
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"店铺简介";
    self.jianjieTextView.delegate = self;
    if (self.jianjieString.length == 0) {
        self.jianjieLabel.hidden = NO;
    }else{
        self.jianjieLabel.hidden = YES;
    }
    // Do any additional setup after loading the view from its nib.
}

- (void)textViewDidBeginEditing:(UITextView *)textView
{
    self.jianjieLabel.hidden = YES;
}
- (void)textViewDidEndEditing:(UITextView *)textView
{
    if (textView.text.length == 0) {
        self.jianjieLabel.hidden = NO;
    }
}
@end
